package com.holiday.eshop.ui.activity;

import android.support.v4.app.FragmentTabHost;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;

import com.holiday.common.base.BaseActivity;
import com.holiday.eshop.R;
import com.holiday.eshop.module.constants.MainTabs;

public class MainActivity extends BaseActivity {
    FragmentTabHost host;
    
    @Override
    public int getLayoutRes() {
        return R.layout.activity_main;
    }
    
    @Override
    public void initView() {
        
        host = (FragmentTabHost) findViewById(R.id.host);
        host.setup(this, getSupportFragmentManager(), R.id.content);
    
        MainTabs[] values = MainTabs.values();
        for (int i = 0; i < values.length; i++) {
            TabHost.TabSpec spec = host.newTabSpec(values[i].getTag());
            ImageView imageView = new ImageView(this);
            imageView.setBackgroundResource(values[i].getResId());
            spec.setIndicator(imageView);
            host.addTab(spec, values[i].getClazz(), null);
        }

    }
    
    @Override
    public void initListener() {
        
    }
    
    @Override
    public void initData() {
        
    }
    
    @Override
    public void onClick(View v, int id) {
        
    }
}
